1. Field of the Invention
The present invention generally relates to the implementation of instruction jumps in a program executed by a microprocessor. The present invention more specifically relates to jumps performed by a program implementing secret quantities which are desired to be made undetectable from a possible pirate.
2. Discussion of the Related Art
In most programs or algorithms executed by a microprocessor, conditional jumps, that is, steps during which the program selects the next instruction to be executed from among two different instructions, can be found. Such jumps are generally decided according to the state of a flag or condition bit. According to the state of the flag bit, the program execution carries on with one instruction or the other. At this time, the conditional jump intervenes to direct the program towards a different address.
Such an operation is fully satisfactory in many applications. However, in programs handling secret quantities or more generally implementing algorithms for which it is not desired for an unauthorized user to be able to modify the program sequencing, such jumps form particularly vulnerable points.
In particular, a widespread type of attack to deduce secret quantities from the execution of an algorithm, known as the fault injection attack, consists of forcing a trap in a program by introducing a disturbance (for example, on the processor supply), at strategic program execution positions. Such fault injections then enable discovering the handled secret quantities. For example, and in simplified fashion, if a conditional jump verifies the exactness of a key with respect to a pre-recorded key, the conditional jump to the authorized instructions must not occur if the right key is not introduced in a corresponding variable of the program. By presenting a wrong key and causing disturbances on the program execution (fault injection), a wrong (illicit) conditional jump resulting in the accepting of the wrong key will statistically occur. Now, it is enough for the jump to be authorized once to enable a pirate to exploit the processings performed by the algorithm and thus hack the program.
FIG. 1 very schematically illustrates an execution mode of a conventional jump in a program. Whatever the variables processed at input E, each time a test (block 1, IF) is provided in a program, the next instruction in the program development is different at least in its execution address. For example, if the test is negative (output state 0), the executed instruction often is the next instruction (block 2, NEXT). However, if the test is validated (output state 1), the program executes an instruction (block 3, JUMP) at another address @ in the program or in a sub-program. The two outputs may condition jumps on different addresses.
To protect the program execution against fault injections, two techniques are conventionally used.
FIG. 2 very schematically illustrates, in the form of blocks, a first technique for protecting the execution of a program against fault injections. This techniques consists of performing two executions (block 10, EXEC 1 and block 11, EXEC 2) of the same program in parallel, or shifted in time, and of comparing (BLOCK 12, COMP), the results provided by each of the executions to validate the correct execution of the program. Comparator 12, for example, provides a state bit VALID indicating that the results of the two executions are identical, thus validating the program execution with no fault injection. The used result indifferently is that of one or the other of the executions (for example, that of block 10).
A disadvantage of this technique is either that it requires two hardware program execution cells in the case of a parallel execution, or that it takes time since the program must be executed twice before a valid result can be taken into account.
A second known technique consists of calculating signatures of two executions in parallel of the same program for, here again, comparing the signatures with a pre-recorded signature or with each other. As in the case of FIG. 2, this requires two executions and thus two hardware cells, or twice as much time. Further, the integrated circuit executing the program must have the functions enabling calculation of such signatures.
An additional disadvantage of the two above-described conventional techniques is that they only enable a detection a posteriori.
A technical problem is that a program must have a reproducible execution, that is, that it must develop correctly in the absence of a piracy attempt. In other words, this technical problem is linked to the fact that the program and especially the conditional jumps must be provided in advance for a given operation of the program, which makes it sensitive to fault injection attacks.
Document WO-A-00/42511 discloses a jump system in a program, in which a jump address is a function of a test result taking into account a base address and a variable. This document aims at avoiding attacks based on power analysis of the integrated circuit executing the program. Such a solution is ineffective against fault injection attacks to which relates the present invention.